<template>
  <div>这是first。。。。。</div>
  <input type="text" placeholder="请输入信息" />
  <button @click="aaa">更新信息--修改公共数据massage</button>

  <h1>---{{ count }}------{{ getmsg }}----</h1>
  <button @click="bask">异步操作修改数据</button>
</template>
<script>
import { mapState, mapMutations, mapGetters } from 'vuex'
import { mapActions } from 'vuex'
export default {
  computed: {
    ...mapState('child', ['count']),
    ...mapGetters('child', ['getmsg'])
  },
  data() {
    return {
      msg: ''
    }
  },
  created() {
    console.log(this.$store)
  },
  methods: {
    ...mapMutations('child', ['mass']),
    ...mapActions('child', ['asyncmsg']),
    bask() {
      // console.log(this.$router, this.$route)
      // this.$store.commit('increment')
      // this.$store.dispatch('asyncmsg')
      this.asyncmsg()
    },
    aaa() {
      this.mass()
    }
  }
}
</script>
<style scoped></style>
